Enforce module signatures if the kernel is locked down
authorDavid Howells <dhowells@redhat.com>
Wed, 5 Apr 2017 16:40:30 +0000 (17:40 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 14 Jan 2018 19:45:05 +0000 (19:45 +0000)
If the kernel is locked down, require that all modules have valid
signatures that we can verify.

Signed-off-by: David Howells <dhowells@redhat.com>
Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name 0041-Enforce-module-signatures-if-the-kernel-is-locked-do.patch

kernel/module.c

index de66ec82599289d786063457ef46a3619893bb03..0ebd1a50322848c07887cfa9a8e0f74637b84854 100644 (file)
@@ -2781,7 +2781,7 @@ static int module_sig_check(struct load_info *info, int flags)
        }
 
        /* Not having a signature is only an error if we're strict. */
-       if (err == -ENOKEY && !sig_enforce)
+       if (err == -ENOKEY && !sig_enforce && !kernel_is_locked_down())
                err = 0;
 
        return err;